﻿
Partial Class Hosteria_VS_Disponibilidad
    Inherits System.Web.UI.Page



    Protected Sub CrearReserva()
        Session("addOne") = "Yes"
        Session("habitacion") = GridView1.SelectedRow.Cells(1).Text
        Session("desde") = txtDesde.Text
        Session("hasta") = txtHasta.Text
        Server.Transfer("~/Reservas.aspx")
    End Sub

    Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
        CrearReserva()
    End Sub

    Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
        If Calendar1.Visible Then
            Calendar1.Visible = False
        Else
            Calendar1.Visible = True
        End If
    End Sub

    Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
        txtDesde.Text = Calendar1.SelectedDate.ToShortDateString
        Calendar1.Visible = False
    End Sub

    Protected Sub ImageButton2_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton2.Click
        If Calendar2.Visible Then
            Calendar2.Visible = False
        Else
            Calendar2.Visible = True
        End If
    End Sub

    Protected Sub Calendar2_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar2.SelectionChanged
        txtHasta.Text = Calendar2.SelectedDate.ToShortDateString
        Calendar2.Visible = False
    End Sub

    
    Protected Sub ButtonB_Click(sender As Object, ByVal e As EventArgs) Handles ButtonB.Click
        sdaHabitacionesDisponibles.SelectParameters("fechaDesde").DefaultValue = txtDesde.Text
        sdaHabitacionesDisponibles.SelectParameters("fechaHasta").DefaultValue = txtHasta.Text
        sdaHabitacionesDisponibles.Select(DataSourceSelectArguments.Empty)
    End Sub

End Class
